<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>编辑文章</title>
		<script charset="utf-8" src="editor/kindeditor.js"></script>
		<script>
	KE.show( {
		id : 'paper_description',
		resizeMode : 1,
		items : [ 'source', '|', 'fullscreen', 'undo', 'redo', 'print', 'cut',
				'copy', 'paste', 'plainpaste', 'wordpaste', '|', 'justifyleft',
				'justifycenter', 'justifyright', 'justifyfull',
				'insertorderedlist', 'insertunorderedlist', 'indent',
				'outdent', 'subscript', 'superscript', '|', 'selectall', '-',
				'title', 'fontname', 'fontsize', '|', 'textcolor', 'bgcolor',
				'bold', 'italic', 'underline', 'strikethrough', 'removeformat',
				'|', 'image', 'flash', 'media', 'advtable', 'hr', 'emoticons',
				'link', 'unlink', '|', 'about' ]
	});
</script>
	</head>
	<body>
		<h1>
			<s:if test="editOrAdd=='add'">添加</s:if><s:else>编辑</s:else>-${category.name}
		</h1>
		<div class="div_article">
			<s:form namespace="/paper" action="saveOrUpdatePaper" method="POST" theme="simple" enctype="multipart/form-data">
				<input type="hidden" name="cid" value="${category.cid}" />
				<input type="hidden" name="paper.uuid" value="${paper.uuid}" />
				<input type="hidden" name="paper.cid" value="${paper.cid}" />
				<input type="hidden" name="paper.id" value="${paper.id}" />
				<input type="hidden" name="editOrAdd" value="${editOrAdd}" />
				<table class="table_item">
					<tbody>					
						<tr>
							<th>
								分类：
							</th>
							<td>
								<s:if test="editOrAdd=='add'">
									<select id="cc" class="easyui-combobox" name="paper.type" style="width:200px;" data-options="required:true">										
											<option value="06">总论</option>				
											<option value="01">马克思主义基本原理概论</option>
											<option value="04">思想道德修养与法律基础</option>
											<option value="02">毛泽东思想和中国特设社会主义理论体系概论</option>
											<option value="03">中国近现代史纲要</option>				
									</select>
								</s:if>
								<s:else>									
									<input type="hidden" name="paper.type" value="${paper.type}" />
									<s:if test="paper.type=='01'">马克思主义基本原理概论</s:if>
									<s:elseif test="paper.type=='04'">思想道德修养与法律基础</s:elseif>
									<s:elseif test="paper.type=='02'">毛泽东思想和中国特设社会主义理论体系概论</s:elseif>
									<s:elseif test="paper.type=='03'">中国近现代史纲要</s:elseif>
									<s:elseif test="paper.type=='06'">总论</s:elseif>
								</s:else>
							</td>
						</tr>
						<tr>
							<th>
								标题：
							</th>
							<td>
								<s:textfield name="paper.title" cssClass="input_long"></s:textfield>
							</td>
						</tr>	
						<tr>
							<th>
								作者：
							</th>
							<td>
								<s:textfield name="paper.authorName" cssClass="input_long"></s:textfield>
							</td>
						</tr>	
						<tr>
							<th>
								<s:if test="category.cid==10">来源：</s:if>
								<s:else>刊物：</s:else>
							</th>
							<td>
								<s:textfield name="paper.source" cssClass="input_long"></s:textfield>
							</td>
						</tr>
						<tr>
							<th>
								发表时间：
							</th>
							<td>
								<input class="easyui-datebox"  style="width:150px" name="paper.publishDate" data-options="required:true" value=${paper.publishDate}></input>
							</td>
						</tr>				
						<tr>
							<th>
								附件：
							</th>
							<td>
								<s:file name="paperFile" value="paperFile" cssClass="input_long"></s:file>
								<br/>
								<s:if test="editOrAdd=='edit'">
								<a href="paper/downloadPaperEnclosure.action?uuid=${paper.uuid}">${paper.filePath}</a></s:if>
							</td>
						</tr>
						<tr>
							<th>
								简介：
							</th>
							<td>
								<s:textarea id="paper_description" name="paper.description"
									cols="80" rows="30"></s:textarea>
							</td>
						</tr>
						<tr>
							<td>
							</td>
							<td>
								<s:submit value="提    交"></s:submit>
							</td>
						</tr>
					</tbody>
				</table>
			</s:form>
		</div>
	</body>
</html>